package com.hdax.dm.rest;

import com.hdax.dm.common.api.SchedulerControllerApi;
import com.hdax.dm.scheduler.DmScheduler;
import com.hdax.dm.scheduler.DmSchedulerSeat;
import com.hdax.dm.scheduler.DmSchedulerSeatPrice;
import com.hdax.dm.service.SchedulerPriceService;
import com.hdax.dm.service.SchedulerSeatSevrice;
import com.hdax.dm.service.SchedulerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
@Service
public class SchedulerRestMapper implements SchedulerControllerApi {

    @Autowired
    private SchedulerService schedulerService;
    @Autowired
    private SchedulerPriceService schedulerPriceService;

    @Autowired
    private SchedulerSeatSevrice schedulerSeatSevrice;
    @Override
    public List<DmScheduler> dmScheduler(@RequestParam("itemId")String itemId) {
        return schedulerService.schedulers(itemId);
    }

    @Override
    public List<DmSchedulerSeatPrice> dmSchedulerPrice(@RequestParam("itemId") String scheduleId) {

        return schedulerPriceService.SchedulerPrices(scheduleId);
    }

    @Override
    public List<DmSchedulerSeatPrice> schedulerPriceIdAreaId(Long scheduleId, Long areaLevel) {
        return schedulerPriceService.SchedulerPrices(scheduleId,areaLevel);
    }

    @Override
    public List<DmSchedulerSeat> dmSchedulerSeat(Long x, Long y, Long scheduleId) {

        return schedulerSeatSevrice.seatXYScheIds(x, y, scheduleId);
    }

    @Override
    public Boolean updataSeat(DmSchedulerSeat seat) {
        return schedulerSeatSevrice.updateSeat(seat);
    }


    @Override
    public Boolean updataXY(String orderNo) {
        return schedulerSeatSevrice.updateSeatXy(orderNo);
    }


}
